public class Tester {
	public static void main(String[] args) {
		
		//R6.2--what does the following code print:
		//for (int i = 0; i < 10; i++)
		//{
		//for (int j = 0; j < 10; j++)
		//	System.out.print(i * j % 10);
		//	System.out.println();
		//}
		//This code will print out the following:
		// 0000000000
		// 0123456789
		// 0246802468
		// 0369258147
		// 0482604826
		// 0505050505
		// 0628406284
		// 0741852963
		// 0864208642
		// 0987654321
		
		//R6.3
		//a
		//for (int i = 1; i <= 10; i++)
		//{
		//	System.out.println(i);
		//}
		// This one will run until i is greater than 10, a total of 10 times
		
		//b
		//for (int i = 0; i < 10; i++)
		//{
		//	System.out.println(i);
		//}
		// This one will will only go up to 9, a total of 10 times
		
		// e
		//for (int i = 10; i >= 0; i++)
		//{
		//	System.out.println(i);
		//}
		// This one will run infinitely, since i is already greater than 0
		
		// f
		//for (int i = -10; i <= 10; i = i + 2)
		//{
		//	System.out.println(i);
		//}
		// This one will execute 11 times
		
		// R6.4 Rewrite the following for loop into a while loop
		//int s = 0;
		//for (int i = 1; i <= 10; i++) s = s + i;
		
		//int s = 0;
		//int i = 1;
		//while (i <= 10)
		//{
		//	s = s + i;
		//	i++;
		//}
		//System.out.println(s);
		
		// Calculates 10 factorial using a 'while' loop
		//int i = 1;
		//int sum = 1;
		//while (i <= 10)
		//{
		//	sum = sum * i;
		//	i++;
		//}
		//System.out.println(sum);
		
		// Calculates 10 factorial using a 'for' loop
		//int i = 0;
		//int sum = 1;
		//for (i = 1; i <= 10; i++)
		//{
		//	sum = sum * i;
		//}
		//System.out.println(sum);
		
		// Calculates 10 factorial using a 'do' loop
		//int i = 1;
		//int sum = 1;
		//do
		//{
		//	sum = sum * i;
		//	i++;
		//}
		//while (i <= 10);
		//System.out.println(sum);
		
		// Implements an infinite loop
		//int i = 1;
		//int sum = 1;
		//while (i >= 1)
		//{
		//	sum = sum * i;
		//	i++;
		//	System.out.println(sum);
		//}
		// Output of the infinite loop is '0' repeating
		
		// Implements a nested 'for' loop
		//int i = 0;
		//int j = 0;
		//for (i = 0; i <= 20; i++)
		//{
		//	for (j = 0; j <= i/2; j++)
		//	{
		//		System.out.println(j);
		//	}
		//	System.out.println(i);
		//}
		//System.out.println(i + " " + j);
	}
}
